import VueRouter from 'vue-router'
import Vue from 'vue'

// 创建 router 实例，然后传 `routes` 配置
Vue.use(VueRouter)
const routes = [
  { 
    path: '/',
    redirect: '/1-1'
  },
  {
    path: '/1-1',
    name: 'home',
    component: () => import('./page/page1')
  },
  {
    path: '/1-2',
    name: '1-2',
    component: () => import('./page/page2')
  },
  {
    path: '/1-3',
    name: '1-3',
    component: () => import('./page/page3')
  },
  {
    path: '/2',
    name: '2',
    component: () => import('./page/page4')
  },
  {
    path: '/3',
    name: '3',
    component: () => import('./page/page5')
  },
  {
    path: '*',
    redirect: '/1-1'
  },
]

export default new VueRouter({
  routes // (缩写) 相当于 routes: routes
})